#include<iostream>
using namespace std;
const int N = 110;
int n, k, x;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n >> k >> x;
		bool flag = 0;
		int z = k;
		if (k == x) z = k - 1;
		if (!z) {
			cout << "NO" << endl;
			continue;
		}
		if (n % z == x && x == 1 && z == 2) {
			cout << "NO" << endl;
			continue;
		}
		while (z == x) {
			z--;
		}
		while (n % z == x) {
			z--;
		}
		if (!z) {
			cout << "NO" << endl;
			continue;
		}
		if (n % z != x) {
			cout << "YES" << endl;
			int cnt = n / z + (n % z != 0);
			cout << cnt << endl;
			for (int i = 0; i < n / z; i++)cout << z << " ";
			if (n % z != 0)cout << n % z << endl;
			else cout << endl;
		}
		else {
			if (x == 1) {
				cout << "NO" << endl;
				continue;
			}
			cout << "YES" << endl;
			int cnt = n / z + n % z;
			cout << cnt << endl;
			for (int i = 0; i < n / z; i++)cout << z << " ";
			for (int i = 0; i < n % z; i++)cout << 1 << " ";
			cout << endl;
		}
	}
	return 0;
}